package
{
	import mx.core.mx_internal;
	import mx.logging.Log;
	import mx.logging.LogEventLevel;
	import mx.logging.targets.LineFormattedTarget;
	use namespace mx_internal;

	public class LogTarget extends LineFormattedTarget
	{
		//public var _logTarget:LogTarget;
		public var logFilter:String="com.suntech.logging";
		public var logText:String="";
		/*public function getLogTarget():LogTarget
		{
			if (_logTarget == null)
			{
				_logTarget=new LogTarget();
				_logTarget.level=LogEventLevel.INFO;
				//this.includeDate=true;
				_logTarget.includeLevel=true;
				//this.includeTime=true;
				_logTarget.includeCategory=true;
				//Only shows message in this package.
				_logTarget.filters=[main.logFilter];

				_logTarget.level=LogEventLevel.INFO;

				Log.addTarget(_logTarget);
			}
			return _logTarget;
		}
*/

		public function LogTarget()
		{
			//TODO: implement function
			super();
			this.level=LogEventLevel.INFO;
			//this.includeDate=true;
			this.includeLevel=true;
			//this.includeTime=true;
			//this.includeCategory=true;
			//Only shows message in this package.
			this.filters=[logFilter];
			
			Log.addTarget(this);

		}

		mx_internal override function internalLog(message:String):void
		{
			logText+=message + "\n";
		}
	}



}
